package com.bruceli.controller;


import com.bruceli.pojo.Customer;
import com.bruceli.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/customer")
public class CustomerController {

    @Autowired
    private CustomerService customerService;

    @RequestMapping("/findAll")
    public String findAll(Model model){

        List<Customer> customerList = customerService.findAll();

        model.addAttribute("list",customerList);

        System.out.println("测试");
        System.out.println("测试");

        return "list";
    }
}
